/* Copyright Rex All rights reserved. */
enyo.kind({
	name: "com.RexToy.engyView",
	kind: com.RexToy.abstractCvtView,
	components: [
		{kind: "BasicScroller", components: [
			{kind:"RowGroup", components: [
				{name: "w", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Watt")}
					]},
				{name: "hp", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Horse Power")}
					]},
				{name: "kc", richContent: false, kind: "Input", onblur:"blur", components: [
						{className: "hint", content: $L("Kcal/s")}
					]}
			]}
		]}
      ],
	
	fomular: {
		"w->w": "w",
		
		"w->hp": "w/735.2941",
		"hp->w": "hp*735.2941",		
		"w->kc": "w/4184.1004",
		"kc->w": "kc*4184.1004"
	},
	
	units: ["w","hp","kc"],
	baseUnit: "w",
	
	blur: function(sender)
	{
		if(this.isNumber(sender))
		{
			this.calc(sender.name, this.getNumber(sender));
		}
	}
});